package com.shujia.hdfs;


import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;

import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;

public class Code01FileSystemCon {
    public static void main(String[] args) throws URISyntaxException, IOException {
        Configuration conf = new Configuration();
        // 由于当前FileSystem没有构造方法 可以通过get
        FileSystem fileSystem = FileSystem.get(new URI("hdfs://master:9000"), conf);
        // org.apache.hadoop.hdfs.DistributedFileSystem
        System.out.printf("连接成功... FileSystem子实现类："+fileSystem.getClass().getName());
        fileSystem.close();
    }
}
